<?php

class DatePicker {

    function chooseDate() {
	
	$month = array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
 	$monthNum = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');
 
	echo '<select name="Month">' . "\n";
 
	// loop while $i is less than count(the amout of elements) of $arr
	for($i=0; $i < count($month); $i++) {
   		echo '<option value="'. $monthNum[$i] . '">' . $month[$i] . "</option>\n";
   	}
 
	echo "</select>\n";
	
	$day = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31');
 
	echo '<select name="Day">' . "\n";
 
	// loop while $i is less than count(the amout of elements) of $arr
	for($i = 0; $i < 31; $i++) {
   		echo '<option value="' . $day[$i] . '">' . $day[$i] . "</option>\n";
   	}
 
	echo "</select>\n";

	// set time zone so php doesn't freak out
	date_default_timezone_set('America/Chicago');
	// find the current year
	$currentYear = date('Y');
 
	echo '<select name="Year">' . "\n";
 
	// loop to add two more years in addition to the current year
	for($i = 0; $i < 3; $i++) {
   		echo '<option value="' . ($currentYear + $i) . '">' . ($currentYear + $i) . "</option>\n";
   	}
 
	echo "</select>\n";

	}
	
}

?>